#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>

using namespace std;

#define maxn 1000

const double zero=1e-8;
const double pi=acos(-1.);

struct point{
	double x, y;
	point( double xx=0, double yy=0 ){
		x=xx; y=yy;
	}
	bool operator ==( const point &b ) const{
		return fabs(x-b.x)<=zero && fabs( y-b.y )<=zero;
	}
};

struct circle{
	point ct;
	double r;
	bool operator ==( const circle &b ) const{
		return ct==b.ct && fabs(r-b.r)<zero;
	}
};

int n, toti;
circle c[maxn];
int have[maxn][maxn], tot[maxn];
point intsec[maxn*maxn]; 
int nxt[maxn*maxn];
bool can[maxn];
double ans;
int now;

double sqr( double x ){
	return x*x;
}

double dist(point a, point b){
	return sqrt(sqr(a.x-b.x)+sqr(a.y-b.y));
}

bool isin(int i, int j){
	if ( c[i].r - dist( c[i].ct, c[j].ct ) - c[j].r>zero)
		return true;
	else
		return false;
}

void get_cross(int i, int j){
	double cotmp, tmp, now, aa, bb, cc, tmp;
	now=atan2( c[j].ct.y-c[i].ct.y, c[j].ct.x-c[i].ct.x );
	if ( now<-zero ) now+=2*pi;
	double l=dist( c[i].ct, c[j].ct );
	cotmp=(sqr(c[i].r)+sqr(l)-sqr(c[j].r))/2/c[i].r/l;
	tmp=acos(cotmp);
	double t1=now-tmp, t2=now+tmp;
	if ( t1<-zero ) t1+=2*pi;
	if ( t2-2*pi>zero ) t2-=2*pi;
}


int main(){
	int i;
	
	scanf("%d", &n);
	for (int i=0; i<n; i++)
		scanf("%lf%lf%lf", &c[i].ct.x, &c[i].ct.y, &c[i].r);

	memset(can, true, sizeof(can));
	for ( int i=0; i<n; i++){
		for ( int j=i+1; j<n; j++)
			if ( c[i]==c[j] )
				can[j]=false;
	}
	for ( int i=0; i<n; i++)
		for ( int j=0; j<n; j++){
			if ( fabs(c[i].r-c[j].r)<zero) continue;
			if (isin(i, j)){
				can[i]=false; break;
			}
		}

	int tmp;
	tmp=n; n=0;
	
	for (i=0; i<tmp; i++)
		if ( can[i] )
			c[n++]=c[i];

	for ( int i=0; i<n; i++){
		for ( int j=i+1; j<n; j++)
			get_cross(i, j);
		if (tot[i]>0) {
			sort( have[i], have[i]+tot[i], cmp );
		} else
			ans+=pi * sqr( c[i].r );
	}
	printf("%lf", ans);
}
